package com.lang.enums;

/**
 * creat by SimonLang
 * 2022/12/30 21:05
 */

public enum DataSourceEnum {
    MYSQL(1001,"MYSQL"),
    ORACLE(1002,"ORACLE"),
    ELASTICSEARCH(1003,"ELASTICSEARCH"),
    KAFKA(1004,"KAFKA"),
    REDIS(1005,"REDIS"),
    FTP(1007,"FTP"),
    HIVE(1008,"HIVE")
    ;

    private Integer code;

    private String type;

    DataSourceEnum(Integer code, String type){
        this.code = code;
        this.type = type;
    }

    public Integer getCode() {
        return code;
    }

    public String getType(){
        return type;
    }

    public static DataSourceEnum getEnumByCode(Integer code){
        for (DataSourceEnum dataSourceEnum : DataSourceEnum.values()){
            if(dataSourceEnum.getCode().equals(code)){
                return dataSourceEnum;
            }
        }
        return null;

    }
}

